.PHONY: all clean

CFLAGS = -Wall -g -I../liblcom -I.. 

# Cada ficheiro .c corresponde a um teste diferente
SRC = $(wildcard *.c)
OBJ = $(SRC:.c=.o)
EXE = $(SRC:.c=.exe)

ASM_SRC = $(wildcard *.asm)
ASM_OBJ = $(ASM_SRC:.asm=.o)

ALEXK_O = $(subst ../main.o,, $(wildcard ../*.o))

all: $(EXE)


%.o: %.c
	gcc $(CFLAGS) -c $<

%_isr.o: %_isr.asm
	nasm -t -f coff $<

	

%_asm.o: %_asm.asm
	nasm -t -f coff $<

%.exe: %.o $(ALEXK_O)
	gcc -Wall -o $@ $^ ../liblcom/liblcom.a
	

clean:

	del $(OBJ)
	del $(ASM_OBJ)
	del $(EXE)


